package com.bom.boot.easy.entity;

import com.bom.boot.easy.core.comment.Comment;
import lombok.Data;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.HashSet;
import java.util.Set;

@Data
@Entity(name = "ops_page")
@Comment("页面表")
public class PageEntity{
    @Id
    @Comment("页面")
    private String name;

    @Comment("页面标题")
    private String title;

    /**
     * 可以添加很多个页面操作
     */
    @OneToMany(mappedBy = "id.page", cascade = CascadeType.ALL)
    private Set<OptionEntity> options = new HashSet<>();
}
